using System;
using System.Collections.Generic;
using System.Text;

namespace Eve.Data
{
    public class Unit : EveProperty
    {
        private string unitName;
        private string displayName;
        private string description;

        public string Name
        {
            get { return unitName; }
        }
        public string DisplayName
        {
            get { return displayName; }
        }
        public string Description
        {
            get { return description; }
        }

        internal Unit(DbDataRow dr)
            : base(dr.Database, EvePropertyType.Unit, dr["unitID"])
        {
            Fill(dr);
        }
        internal Unit(Database db, int id)
            : base(db, EvePropertyType.Unit, id)
        {
            Fill(db.ExecuteSingle("SELECT * FROM eveUnits WHERE unitID=" + id));
        }

        private void Fill(DbDataRow dr)
        {
            unitName = dr["unitName"];
            displayName = dr["displayName"];
            description = dr["description"];
        }
    }
}
